import requests
from fake_useragent import UserAgent
from lxml import etree
import re
import time

def myxpath(page,ruler):
    return etree.HTML(page).xpath(ruler)

headers = {
        'User-Agent': UserAgent().random,
    }
url = 'https://www.baidu.com/s?wd=西红柿的功效与作用&pn=0&oq=西红柿的功效与作用'
res = requests.get(url=url,headers=headers).text
a = ''.join(myxpath(res,'//*[@id="content_left"]/div[@class="result c-container new-pmd"]//text()'))
print(a)